// projectetuler.net - problem 7

import std.stdio;
 
void main()
{
    int say = 0;
    int x = 1;
    int dak;
    int gec;
 
    while(say <= 10001){
        x++;
        gec = true;
        dak = x / 2;
        for(int i= 2; i < dak; i++){
            if(!(x%i)){
                gec = false;
            }
            dak = x / i;
        }
        if(gec)
            say++;
    }
 
    writeln(x);
}
